﻿
package org.apache.xinclude4flex.events {
	
	/**
	 * @author gavingui2011@gmail.com (Gavin Lei)
	 */
	
	import flash.events.ProgressEvent;
	import flash.events.Event;
	
	public class MultiProgressEvent extends ProgressEvent{
		
		private var _loadIndex	:int;
		private var _totalLoads	:int;
		
		public static const PROGRESS:String = "progress";
		
		public function MultiProgressEvent(type:String, bubbles:Boolean = false, cancelable:Boolean = false, bytesLoaded:Number = 0, bytesTotal:Number = 0, loadIndex:int = -1 , totalLoads:int = -1) {
			super(type, bubbles, cancelable, bytesLoaded, bytesTotal);
			_loadIndex 	= loadIndex;
			_totalLoads = totalLoads;
		}
		
		public override function clone():Event{
			return new MultiProgressEvent(type, bubbles, cancelable, bytesLoaded, bytesTotal, loadIndex, totalLoads);
		}
		
		public override function toString():String {
			return formatToString("MultiProgressEvent", "type", "bubbles", "cancelable", "bytesLoaded", "bytesTotal", "loadIndex", "totalLoads");
		}
		
		public function get loadIndex():int { return _loadIndex; }
		public function set loadIndex(value:int):void {
			_loadIndex = value;
		}
		
		public function get totalLoads():int { return _totalLoads; }
		public function set totalLoads(value:int):void {
			_totalLoads = value;
		}
	}
}